home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
SWAB.A
< prev
next >
Wrap
Text File
|
1985-07-23
|
426b
|
27 lines
; swab.a - swap bytes.
; (C) Copyright 1985 Cray Research Inc. - All Rights Reserved.
; G. R. Mansfield. 85/07/23.
; Ver 1.0-5723.
cseg
public swab_
; void swab(from, to, nbytes)
; BYTE *from, *to;
; int nbytes;
swab_:
mov bx,sp
mov si,[bx+2] ; source
mov di,[bx+4] ; destination
mov cx,[bx+6] ; count
sar cx,1 ; word count
jle swa2
swa1: lodsw
xchg ah,al
stosw
loop swa1
swa2: ret